<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>后台管理主页面</title>
    
   <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-2.0.0.min.js"></script>
   <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-ui"></script>
   <link href="${pageContext.request.contextPath }/css/bootstrap-combined.min.css" rel="stylesheet" media="screen">
   <script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
    <script type="text/javascript">
    	function doDelete(id)
    	{
    		if(window.confirm('你确认需要删除吗？'))
    		{
    			window.location.href="${pageContext.request.contextPath}/admin/essay_EssayDelete.action?essay.id="+id;
    		}
    		else
    		{
    			
    		}
    		
    		
    	}
    	function doEditor(id)
    	{
    		window.location.href="${pageContext.request.contextPath}/admin/essay_Essayfind.action?essay.id="+id;
    	}
    </script>
    
    
  </head>
  
 <body>
	<div>欢迎 <s:property value="#session.loginSession.userName"/></div>
	<a href="${pageContext.request.contextPath }/admin/admin_loginOut.action">退出后台管理</a>
  <div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<h3 class="text-center">
				TmT后台管理
			</h3>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span3">
			<ul class="nav nav-list">
				<li class="nav-header">
					列表标题
				</li>
				<li class="active">
					<a href="#">首页</a>
				</li>
				<li id="Add">
					<a href="${pageContext.request.contextPath }/admin/img_loadImg.action">前台图片</a>
				</li>
				<!--<li>
					<a href="#">应用</a>
				</li>
				<li class="nav-header">
					功能列表
				</li>
				<li>
					<a href="#">资料</a>
				</li>
				<li>
					<a href="#">设置</a>
				</li>
				<li class="divider">
				</li>  -->
				<li>
					<a href="#">关于本站</a>
				</li>
			</ul>
		</div>
		<div class="span9">
		<a href="${pageContext.request.contextPath }/admin/essay_EssayAddUI.action">添加文章</a>
		
			<table class="table">
				<thead>
					<tr>
						<th>
							编号
						</th>
						<th>
							文章标题
						</th>
						<th>
							文章简介
						</th>
						<th>
							提交时间
						</th>
						<th>
							点击次数
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
		
				<tbody>
				<s:iterator value="EssayList" status="st">
                            <tr>
                                <td><s:property value="id"/></td>
                                <td ><s:property value="ename"/></td>
                                <td ><s:property value="summary"/></td>
                                <td><s:property value="date"/></td>
                                <td><s:property value="clickHit"/></td>
                                <td><a href="javascript:doEditor('<s:property value='id'/>')">修改</a>&nbsp; <a href="javascript:doDelete('<s:property value='id'/>')">删除</a></td>
                               
                            </tr>
               </s:iterator>
					<!--<c:choose>
						<c:when test="${requestScope.listAll != null }">
							<c:forEach var="essay" items="${listAll }" varStatus="vs">
								<tr>
									<td>${essay.id }</td>
									<td>${essay.ename }</td>
									<td>${essay.date }</td>		
									<td><a>修改</a>&nbsp; <a href="javascript:doDelete('${eaasy.id }')">删除</a></td>
													
								</tr>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<td>对不起</td>
						</c:otherwise>
					
					</c:choose>-->
				</tbody>
			</table>
			<!-- <div class="pagination">
				<ul>
					<li>
						<a href="#">上一页</a>
					</li>
					<li>
						<a href="#">1</a>
					</li>
					<li>
						<a href="#">2</a>
					</li>
					<li>
						<a href="#">3</a>
					</li>
					<li>
						<a href="#">4</a>
					</li>
					<li>
						<a href="#">5</a>
					</li>
					<li>
						<a href="#">下一页</a>
					</li>
				</ul>
			</div>  -->
		</div>
	</div>
</div>
  
  
 </body>
</html>
